package com.example.springbootoauth2.controller;

import com.example.springbootoauth2.model.commons.CallbackResult;
import com.example.springbootoauth2.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class UserController extends BaseController {

    @Autowired
    private UserService userService;

    @GetMapping("/")
    public CallbackResult getAllRole(){
        try{
            return success("成功",userService.getAllRole());
        }catch (Exception e){
            return error("失败",e);
        }
    }

}
